#include<bits/stdc++.h>
using namespace std;
int main()
{
	int R1,n;
	int R2;
	cin>>R1>>n;
	R2=2*n-R1;
	cout<<R2;
	return 0;
}
